<template>
  <fullScreenContainer
    type="fullScreenContainer"
    :leftList="leftList"
    bgSelect="bg3"
    title="湖南省优势特色产业集群可视化分析"
  >
    <div slot="big-body">
      <div class="big-body-header">
        <tabbtn
          v-for="item in tabs_list"
          :active="item.code === tabs_code"
          :key="item.code"
          :title="item.name"
          @click="click(item)"
        ></tabbtn>
      </div>
      <div class="big-body-ctx">
        <div class="big-body-1">
          <img :src="bg" class="bg" alt="" srcset="" />
          <template v-for="(row, index) in rowdata">
            <div :class="'bg'+(index+1)" :key="row.name">
              <span class="dev">{{row.zh}}</span>
              <img :src="bgArr[index]" alt="" srcset="" />
            </div>
          </template>
          <!-- <div class="bg1">
            <span class="dev">xxx责任部门</span>
            <img :src="bg1" alt="" srcset="" />
          </div>
          <div class="bg2">
            <span class="dev">xxx责任部门</span>
            <img :src="bg2" alt="" srcset="" />
          </div>
          <div class="bg3">
            <span class="dev">xxx责任部门</span>
            <img :src="bg3" alt="" srcset="" />
          </div>
          <div class="bg4">
            <span class="dev">xxx责任部门</span>
            <img :src="bg4" alt="" srcset="" />
          </div>
          <div class="bg5">
            <span class="dev">xxx责任部门</span>
            <img :src="bg5" alt="" srcset="" />
          </div>
          <div class="bg6">
            <span class="dev">xxx责任部门</span>
            <img :src="bg6" alt="" srcset="" />
          </div> -->
        </div>
        <div class="big-body-2">
          <Panel key="jdfj" title="产业指挥作战任务（抢收）" height="30%">
            <div class="big-b2-form">
              <el-form :inline="true" label-width="70px">
<!--                <el-form-item label="任务编号">-->
<!--                  <el-input v-model="form.id" placeholder="请输入"></el-input>-->
<!--                </el-form-item>-->
                <el-form-item label="任务名称">
                  <el-input v-model="form.taskName" placeholder="请输入"></el-input>
                </el-form-item>
                <el-form-item label="责任单位">
                  <el-input
                    v-model="form.orgName"
                    placeholder="请输入"
                  ></el-input>
                </el-form-item>
                <el-form-item>
                  <div
                    style="display: flex; height: 40px; align-items: center;"
                  >
                    <img :src="search" @click="clickQuery" alt="" style="position: relative;" />
                  </div>
                </el-form-item>
              </el-form>
            </div>
            <div class="big-b2-table">
              <scroll
                rowStyle="content_tr_center"
                :runSpeed="22"
                :scrollContentHeight="310"
                :columnsConfg="learDataColumnsConfg"
                :rowdata="rowdata"
              >
                <template slot="sort" slot-scope="{ data }">
                  <span>详情</span>
                  <span>短信通知</span>
                </template>
              </scroll>
            </div>
          </Panel>
        </div>
        <div class="big-body-3">
          <Panel
            key="jdfj"
            title="作战任务完成排名分析（抢收top10）"
            height="30%"
          >
            <div class="big-b4-table">
              <!-- <scroll
                rowStyle="content_tr_center"
                :runSpeed="22"
                :scrollContentHeight="210"
                :columnsConfg="learDataColumnsConfg"
                :rowdata="rowdata"
              >
                <template slot="name" slot-scope="{ data }">
                  <span @click="text(data)">
                    aa
                  </span>
                </template>
              </scroll> -->
              <div class="jdfj-bar">
                <echartsDemo
                  key="top"
                  :initData="pmfx"
                  :initChart="topChart"
                ></echartsDemo>
              </div>
            </div>
          </Panel>
        </div>
        <div class="big-body-4">
          <Panel key="jdfj" title="超时任务督办" height="30%">
            <div class="big-b4-table">
              <scroll
                rowStyle="content_tr_center"
                :runSpeed="22"
                :scrollContentHeight="210"
                :columnsConfg="learDataColumnsConfg1"
                :rowdata="rowdata1"
              >
                <template slot="sort" slot-scope="{ data }">
                  <span>详情</span>
                  <span>短信通知</span>
                </template>
              </scroll>
            </div>
          </Panel>
        </div>
      </div>
    </div>
  </fullScreenContainer>
</template>
<script>
import tabbtn from './tabbtn.vue';
import bg from './images/bg.png';
import bg1 from './images/bg1.png';
import bg2 from './images/bg2.png'
import bg3 from './images/bg3.png'
import bg4 from './images/bg4.png'
import bg5 from './images/bg5.png'
import bg6 from './images/bg6.png'
import search from './search.png';
import scroll from '../templateBigScreen/scroll.vue'
import echartsDemo from '@/echartsDemo/index.vue'
import topChart from '../templateBigScreen/topChart'
export default {
  components: {
    tabbtn,
    scroll,
    echartsDemo,
  },
  data() {
    return {
      sxbars: [1, 2, 3],
      leftList: [],
      layerType:null,
      search,
      scroll,
      topChart,
      tabs_code: '1',
      pmfx: [
        {
          executeOorgname: '长沙市',
          zs: 123,
        },
        {
          executeOorgname: '株洲',
          zs: 123,
        },
        {
          executeOorgname: '湘潭',
          zs: 123,
        },
        {
          executeOorgname: '益阳',
          zs: 123,
        },
        {
          executeOorgname: '常德',
          zs: 123,
        },
        {
          executeOorgname: '怀化',
          zs: 123,
        },
        {
          executeOorgname: '吉首',
          zs: 123,
        },
        {
          executeOorgname: '新区',
          zs: 123,
        },
      ],
      tabs_list: [
        {
          name: '抢收作战',
          code: '1',
        },
        {
          name: '干旱作战',

          code: '2',
        },
        {
          name: '病虫害作战',

          code: '3',
        },
        {
          name: '灾情作战',

          code: '4',
        },
      ],
      bg,
      bgArr: [
        bg1,
        bg2,
        bg3,
        bg4,
        bg5,
        bg6,
      ],
      form: {
        id: null,
        taskName: null,
        orgName: null,
      },
      learDataColumnsConfg: [
        {
          label: '任务名称',
          prop: 'class',
          width: '20%',
          paddingLeft: '0px',
        },
        {
          label: '任务子项',
          prop: 'content',
          width: '15%',
          paddingLeft: '0px',
        },
        {
          label: '状态',
          prop: 'datetiem',
          width: '20%',
          paddingLeft: '0px',
        },
        {
          label: '下发时间',
          prop: 'pro',
          width: '15%',
          paddingLeft: '0px',
        },
        {
          label: '责任单位',
          prop: 'zh',
          width: '20%',
          paddingLeft: '0px',
        },
        {
          label: '操作',
          prop: 'sort',
          width: '10%',
          paddingLeft: '0px',
        },
      ],
      rowdata: [

      ],

      learDataColumnsConfg1: [
        {
          label: '任务名称',
          prop: 'class',
          width: '25%',
          paddingLeft: '0px',
        },
        {
          label: '任务子项',
          prop: 'content',
          width: '25%',
          paddingLeft: '0px',
        },
        {
          label: '状态',
          prop: 'datetiem',
          width: '20%',
          paddingLeft: '0px',
        },
        {
          label: '下发时间',
          prop: 'pro',
          width: '15%',
          paddingLeft: '0px',
        },
        {
          label: '操作',
          prop: 'sort',
          width: '20%',
          paddingLeft: '0px',
        },
      ],
      rowdata1: [

      ],
    }
  },
  created() {
    this.layerType = this.$route.query.layerType ? this.$route.query.layerType : '0';
    this.leftList = [
      { name: '数据看板', key: '/bigScreen1?layerType=' + this.layerType },
      {
        name: '驾驶舱', key: '/bigScreen1/jiashicang?layerType=' + this.layerType,
      },
      { name: '挂图作战检测', key: '/bigScreen1/guatuzz?layerType=' + this.layerType },
    ]
    this.getGuatuZzrw({type:'1',layerType:this.layerType});
    this.getGuatuPmfx({type:'1',layerType:this.layerType});
    this.getGuatuCsrw({type:'1',layerType:this.layerType});
  },
  methods: {
    text() {},
    click(v) {
      this.tabs_code = v.code;
      this.getGuatuZzrw({type:this.tabs_code,layerType:this.layerType});
      this.getGuatuPmfx({type:this.tabs_code,layerType:this.layerType});
      this.getGuatuCsrw({type:this.tabs_code,layerType:this.layerType});
    },
    clickQuery(){
      // if(!this.form.id){
      //   this.form.id = null;
      // }
      this.form.type = this.tabs_code;
      this.form.layerType = this.layerType;
      this.getGuatuZzrw(this.form)
    },
    // 获取茶产业指挥作战任务（抢收)
    getGuatuZzrw(data) {
      var ss = this.$api.bigScreenIndex.getGuatuZzrw(data);
      ss.then((res) => {
        //if(res.data.length > 0){
          this.rowdata = [];
        //}
        for(let i=0;i< res.data.length;i++){
           this.rowdata.push({
            name:res.data[i].id,
            class: res.data[i].taskName,
            content: res.data[i].name,
            datetiem: res.data[i].state,
            pro: res.data[i].createTimeString,
            zh: res.data[i].orgName,
            sort: i,
           });
        }

      });
    },
    // 获取挂图作战完成情况排名分析
    getGuatuPmfx(data) {
      var sss = this.$api.bigScreenIndex.getGuatuPmfx(data);
      sss.then((res) => {
       // if(res.data.length > 0){
          this.pmfx = [];
        //}
        for(let i=0;i< res.data.length;i++){
           this.pmfx.push({
            executeOorgname:res.data[i].orgName,
            zs: res.data[i].num
           });
        }

      });
    },
     // 获取超时任务督办
    getGuatuCsrw(data) {
      var ss = this.$api.bigScreenIndex.getGuatuCsrw(data);
      ss.then((res) => {
       // if(res.data.length > 0){
          this.rowdata1 = [];
       // }
        for(let i=0;i< res.data.length;i++){
           this.rowdata1.push({
            name:res.data[i].id,
            class: res.data[i].taskName,
            content: res.data[i].name,
            datetiem: res.data[i].state,
            pro: res.data[i].createTimeString,
            zh: res.data[i].orgName,
            sort: i,
           });
        }

      });
    },
  },
  mounted() {},
}
</script>
<style scoped lang="scss">
.jdfj-bar {
  margin-top: 18px;
  height: 266px;
  opacity: 1;

  /* 自动布局 */
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0px;
  flex-grow: 1;
  align-self: stretch;

  z-index: 2;
}
.big-body-header {
  display: flex;
  justify-content: center;
  gap: 22px;
}
.big-body-ctx {
  margin-top: 16px;
  display: flex;
  padding: 16px;
  gap: 24px;
  flex-wrap: wrap;
  .big-body-1 {
    width: 928px;
    height: 559px;
    border-radius: 5px;
    opacity: 1;
    position: relative;

    /* 自动布局 */
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 24px;

    /* 背景渐变1 */
    background: linear-gradient(
      180deg,
      rgba(17, 77, 71, 0.3) 0%,
      rgba(22, 53, 50, 0.3) 100%
    );

    z-index: 0;
    .bg {
      z-index: 0;
      margin-top: 24px;
    }
    .dev{
      position: absolute;
      padding: 4px 8px;
      background: rgba(35, 67, 64, 0.77);
      color: #D0FFF2;
      font-size: 14px;
      font-weight: 500;
      line-height: 20px;
    }
    .bg1 {
      z-index: 1;
      position: absolute;
      left: 251px;
      top: 289px;
      .dev{
        left: -10px;
        top: 0;
      }
    }
    .bg2 {
      z-index: 1;
      position: absolute;
      left: 445px;
      top: 161px;
      .dev{
        right: 0;
        top: -20px;
      }
    }
    .bg3 {
      z-index: 1;
      position: absolute;
      left: 563px;
      top: 376px;
      .dev{
        left: 0;
        top: 0;
      }
    }
    .bg4 {
      z-index: 1;
      position: absolute;
      left: 336.5px;
      top: 94px;
      .dev{
        left: 20px;
        top: -20px;
      }
    }
    .bg5 {
      z-index: 1;
      position: absolute;
      left: 551px;
      top: 318px;
      .dev{
        right: -20px;
        top: -10px;
      }
    }
    .bg6 {
      z-index: 1;
      position: absolute;
      left: 220px;
      top: 193px;
      .dev{
        left: -10px;
        top: -20px;
      }
    }
  }
  .big-body-2 {
    width: 928px;
    height: 559px;
    border-radius: 5px;
    opacity: 1;

    /* 自动布局 */
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 30px;

    /* 背景渐变1 */
    background: linear-gradient(
      180deg,
      rgba(17, 77, 71, 0.3) 0%,
      rgba(22, 53, 50, 0.3) 100%
    );

    z-index: 1;
    .big-b2-form {
      margin-top: 16px;
    }
    .big-b2-table {
      width: 100%;
    }
  }
  .big-body-3 {
    width: 928px;
    height: 333px;
    border-radius: 5px;
    opacity: 1;

    /* 自动布局 */
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 24px;

    /* 背景渐变1 */
    background: linear-gradient(
      180deg,
      rgba(17, 77, 71, 0.3) 0%,
      rgba(22, 53, 50, 0.3) 100%
    );

    z-index: 2;
  }
  .big-body-4 {
    width: 928px;
    height: 333px;
    border-radius: 5px;
    opacity: 1;

    /* 自动布局 */
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    gap: 30px;

    /* 背景渐变1 */
    background: linear-gradient(
      180deg,
      rgba(17, 77, 71, 0.3) 0%,
      rgba(22, 53, 50, 0.3) 100%
    );

    z-index: 3;
    .big-b4-table {
      width: 100%;
    }
  }
}
</style>
